package com.djdg.foodies.admin.service;

import com.djdg.foodies.common.base.Result;
import com.djdg.foodies.common.entity.Test;
import com.djdg.foodies.common.mapper.TestMapper;
import com.djdg.foodies.common.repository.TestRepository;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

import static com.djdg.foodies.common.base.Result.success;

/**
 * @Description:
 * @Auther Demon
 * @Date 2018/3/13 15:46 星期二
 */
@Service
public class TestService {

    @Resource
    private TestMapper testMapper;
    @Resource
    private TestRepository testRepository;

    public Result<Test> getTestUser(String name) {
        if(name.equals("A"))
            return success(testMapper.getByName(name));
        else
            return success(testRepository.findByName(name));
    }


}
